let quene = [];
let has = {};
import {nextTick} from '../util/next-tick';
function flushSchedularQuene(){
    quene.forEach(watcher=>watcher.run());
    quene = [];
    has = {};
}
export function queneWatcher(watcher){
    let id = watcher.id;
    if(has[id] == null){
        quene.push(watcher);
        has[id] = true;
        //宏任务和微任务
        // Vue.nextTick = promise/mutationObserver/setImmediate/setTimeout
        nextTick(flushSchedularQuene)
        // setTimeout(flushSchedularQuene,0)
    }
}
